package com.feign;

import com.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author : FMH
 * @Date : 2020/2/24 13:38
 * @Description :  @FeignClient:声明当前接口是一个Feign接口
 * fallback:指定一个类专门用于处理UserFeignService的所有调用过程中的异常以及处理
 * @Modify By : 86159
 * @Version :
 */
//@FeignClient(name = "MICROSERVICE-PROVIDER-USER",fallback = UserFeignServiceFallBack.class)
@FeignClient(name = "MICROSERVICE-PROVIDER-USER",fallbackFactory = UserFeignServiceFallBackFactory.class)
public interface UserFeignService {
    //http://MICROSERVICE-PROVIDER-USER/user/get/{id}
    //@PathVariable 之前  如果占位符与参数值一致,value可以不写,而此处必须写
    @RequestMapping("/user/get/{id}")
    User get(@PathVariable("id") Long id);
}
